package architect.dubbo.consumer;

import architect.dubbo.service.DemoService;
import com.alibaba.dubbo.config.annotation.Reference;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

/**
 * Dubbo消费者Controller
 *
 * @author guanxin
 * @date 2018/4/8 16:10
 */

@RestController
public class DemoConsumerController {

    @Reference
    private DemoService demoService;

    @RequestMapping("/sendMessage")
    public String sayHello(@RequestParam String message) {
        return demoService.sendMessage(message);
    }
}
